//泛型上界,针对某个类泛型参数可以填什么,作出限制,
//约定了泛型参数的"父类"

public class Test5 <T extends Number> {
    public static void main(String[] args) {
        Test5 <Integer> t1 = new Test5<>();
        Test5 <Double> t2 = new Test5<>();
        Test5 <Float> t3 = new Test5<>();
        Test5 <Long> t4 = new Test5<>();
        //String就会报错,因为其不是Number的子集
//        Test5 <String> t6 = new Test5<>();

        Test5 <Number> t5 = new Test5<>();
    }
}
